package com.bwie.controller;

import com.bwie.common.domain.Menu;
import com.bwie.common.result.Result;
import com.bwie.service.MenuServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className: MenuController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 汪菲阳
 * @date: 2025/10/22 11:40
 */
@CrossOrigin
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuServcie menuServcie;

    /**
     * 菜单树
     */
    @GetMapping("getMenuTree")
    public Result<List<Menu>> getMenuTree(){
        return Result.success(menuServcie.getMenuTree());
    }
}
